package uicgas.globaldata;

import java.io.Serializable;
import java.net.Socket;

/**
 * the generic register object, to be used by station and pump.
 * @author Steve
 * @version 0.0.1 - Nov, 2010
 */
public class Register extends MessagePayload implements Serializable
{
	int ID;

	public Register()
	{
		ID = 0;
	}

	public Register(int newID)
	{
		ID = newID;
	}


	public int getID()
	{
		return ID;
	}


	/**
	 * Equals statement used to compare on register to another
	 * @author Jesus
	 */
	@Override
	public boolean equals(Object toCompare)
	{
		try
		{
			Register register = (Register) toCompare;
			if (this.ID == register.getID())
				return true;
			else
				return false;

		}
		catch (ClassCastException e)
		{
			return false;
		}
	}

}
